import logging,yaml,yagmail,json

def log_set():
    logging.basicConfig(filename='xiachufang.txt',level=logging.DEBUG,filemode='w+',
                        format='%(asctime)s ->  %(levelname)s -> %(message)s')

def send_mail(fil):
    m = yagmail.SMTP(user='1098120615@qq.com',password='thbqnogfppjsgccg',host='smtp.qq.com')
    m.send(to='1098120615@qq.com',subject='测试报告',contents='qesdewq',attachments=fil)

def get_data(fp):
    with open(fp,'r',encoding='utf-8')as f:
        return yaml.safe_load(f)

def get_data_json(fp):
    with open (fp,'r')as f:
        return json.load(f)

